package com.htudata.hieyes.transctflow.controller;


import com.htudata.common.enums.RequestSeqEnum;
import com.htudata.common.enums.RequestStatusEnum;
import com.htudata.convention.domain.ResponseResult;
import com.htudata.core.util.ResultGenerator;
import com.htudata.hieyes.transctflow.service.TransctFlowService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class TransctFlowController {

  @Autowired
  private TransctFlowService transctFlowService;
  
  @GetMapping({"/v1/transctFlow/transctFlowMonitorNodeData"})
  public ResponseResult getFlowData(@RequestParam("flowId") String flowId) {
    try {
      return ResultGenerator.genResult(RequestSeqEnum.SEQ_027.getCode(), this.transctFlowService.getMonitorNodeData(flowId));
    } catch (Exception e) {

      return ResultGenerator.genErrorResult(RequestSeqEnum.SEQ_027.getCode(), RequestStatusEnum.STATUS_503
          .getCode(), "暂无数据");
    } 
  }
}
